import Vue from 'vue'
import VueRouter from 'vue-router'
import IndexLayOut from '../layout/IndexLayOut.vue'

Vue.use(VueRouter)

// 解决重复点击路由报错问题
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (location) {
    return originalPush.call(this, location).catch(err => err)
}
const routes = [
  {
    path: '/',
    name: 'IndexLayOut',
    component: IndexLayOut
  },
  {
    path: '/LoginDiaLog',
    name: 'LoginDiaLog',

    component: () => import('../components/LoginDiaLog.vue')
  },
  
  {
    path: '/Registered',
    name: 'Registered',

    component: () => import('../components/Registered.vue')
  },

  {
    path: '/ForgotPassword',
    name: 'ForgotPassword',

    component: () => import('../components/ForgotPassword.vue')
  },
  {
    path: '/UserCenterLayOut',
    name: 'UserCenterLayOut',

    component: () => import('../views/userCenter/UserCenterLayOut.vue')
  },

  {
    path: '/ShopCar',
    name: 'ShopCar',

    component: () => import('../views/userCenter/components/ShopCar.vue')
  },
  {
    path: '/SearchClass',
    name: 'SearchClass',

    component: () => import('../views/search/SearchLayout.vue')
  },
  {
    path: '/TwoLay',
    name: 'TwoLay',

    component: () => import('../views/index/components/TwoLay.vue')
  },
  

  //  跳转页面

  
  
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
